<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/js/js.js"></script>
<link rel="stylesheet" href="http://localhost/juanpi/Static/Home/css/index.css" />
<link rel="stylesheet" href="http://localhost/juanpi/Static/Home/css/animate.css" />
<title>列表页</title>
</head>

<body>
<!-- 浏览器右侧开始 -->
<div id="scroll">
	<div class="man">
		<a href="<?php echo U('Member/index');?>"></a>
	</div>
	<div class="shop">
		<a href="<?php echo U('Shop/index');?>">
			<span class="num">
				    <?php if($_SESSION['cart']){ ?>
				<?php echo $hd['session']['cart']['total_rows'];?>
				<?php }else{ ?>0<?php } ?>
			</span>
		</a>
	</div>
	<div class="coll">
		<a href=""></a>
	</div>
	<div class="coup">
		<a href=""></a>
	</div>
	<div class="view">
		<a href=""></a>
	</div>
	<div class="code">
		<a href=""></a>
	</div>
	<div class="top">
		<a href=""></a>
	</div>
</div>
<!-- 浏览器右侧结束 -->	
	
<!--载入顶部-->
<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!-- 顶部开始 -->
<div id="toolbar">
	<!-- ****************登录/注册************** -->
	<div class="tool_r">
		    <?php if(isset($_SESSION['uid'])){ ?>
			<a href="<?php echo U('Member/index');?>"><?php echo $_SESSION['uname'];?></a><a href="<?php echo U('Index/out');?>">退出</a>
		<?php }else{ ?>
			<a href="<?php echo U('Login/index');?>">登录</a>
			<a href="<?php echo U('Register/index');?>">免费注册</a><span>|</span>
		<?php } ?>	
		<a href="<?php echo U('OrdCen/index');?>">我的订单</a>
		<a class="gouwu" href="<?php echo U('Shop/index');?>">
			<span class="gouwudai"></span>购物袋
			<span class="gouwuqiu">
				    <?php if($_SESSION['cart']){ ?>
				<?php echo $hd['session']['cart']['total_rows'];?>
				<?php }else{ ?>0<?php } ?>
			</span>
		</a><span>|</span>
		<a href="">联系客服</a>
	</div>
	<!-- ****************登录/注册************** -->
</div>
<!-- 顶部结束 -->


<!-- 头部开始 -->
<div id="header">
	<div id="top">
		<div class="logo">
			<a href="http://localhost/juanpi/index.php"></a>
		</div>
		<div class="center"></div>
		<div class="right">
			<form action="" method="">
				<input class="text" type="text" name="" id="" />
				<input class="tijiao" type="submit" value="" />
			</form>
		</div>
	</div>
	
</div>
<!-- logo结束 -->

<!-- 导航开始 -->
<div id="mainNav">
	<div class="nav">
		<ul>
			<li class="first"><a href="javascript:;">最新折扣</a></li>
			<?php
$data = K('Cate')->where("pid=0")->order('csort ASC')->limit('1000')->all();
foreach($data as $field):
$field['url'] = U('List/index',array('cid'=>$field['cid']));
?>

				<li><a href="<?php echo $field['url'];?>"><?php echo $field['cname'];?></a></li>
			
<?php endforeach ?>
		</ul>
	</div>
</div>
<!-- 导航结束 -->

<div id="menu">
	<div class="cate">
		<div class="cate_l">
			<ul>
				<?php foreach ($cateData as $k=>$v){?>
 				<li>
 					<div class="list">
 						<p><a class="cate_t" href="<?php echo U('index',array('cid'=>$v['cid']));?>"><?php echo $v['cname'];?></a></p>
 						<?php foreach ($v['son'] as $key=>$value){?>
	 						<p><a href="<?php echo U('index',array('cid'=>$value['cid']));?>"><?php echo $value['cname'];?></a></p>
	 					<?php }?>	
 					</div>
 				</li>
 				<?php }?>
			</ul>
		</div>
		
		<div class="cate_c">
			<?php foreach ($attr as $k=>$v){?>
			<div class="sx">
				<span><?php echo $v['name'];?></span>
				<?php 
					$temp = $param;
					//为"不限"准备的
					$temp[$k] = 0;
				 ?>
				<a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'param'=>implode('_',$temp)));?>"      <?php if($param[$k]==0){ ?>class="bx"<?php } ?> >不限</a>
				<?php foreach ($v['value'] as $key=>$value){?>
					<?php 
						$temp[$k] = $value['gtid'];	
					?>
					<a href="<?php echo U('List/index',array('cid'=>$_GET['cid'],'param'=>implode('_',$temp)));?>"     <?php if($param[$k]==$value['gtid']){ ?>class="bx"<?php } ?> ><?php echo $value['gtvalue'];?></a>
				<?php }?>
			</div>
			<?php }?>
			
		</div>
	</div>
</div>


<div id="news">
	<div class="tit">卷皮新品</div>
	<div class="seac1">
		<a href="<?php echo U('index',array('hat'=>1,'cid'=>$_GET['cid']));?>" ><span     <?php if($_GET['hat']){ ?>class="red"<?php } ?> >热门</span></a>
	    <a href="<?php echo U('index',array('new'=>1,'cid'=>$_GET['cid']));?>" ><span     <?php if($_GET['new']){ ?>class="red"<?php } ?> >最新</span></a>
	    <a href="<?php echo U('index',array('price'=>1,'cid'=>$_GET['cid']));?>" ><span     <?php if($_GET['price']){ ?>class="red"<?php } ?> >价格</span></a>
	    <a href="<?php echo U('index',array('show'=>1,'cid'=>$_GET['cid']));?>" ><span     <?php if($_GET['show']){ ?>class="red"<?php } ?> >销量</span></a>
	</div>
</div>

<!-- 商品列表开始 -->
<div id="goodsList">
	<ul>
		        <?php
        //初始化
        $hd['list']['v'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($goodsData)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($goodsData as $v) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=100)break;
                //第几个值
                $hd['list'][v]['index']++;
                //第1个值
                $hd['list'][v]['first']=($listId == 0);
                //最后一个值
                $hd['list'][v]['last']= (count($goodsData)-1 <= $listId);
                //总数
                $hd['list'][v]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
		<li>
			<div class="new"></div>
			<a href="<?php echo U('Content/index',array('gid'=>$v['gid']));?>">
				<img width=285 height=285 src="http://localhost/juanpi/<?php echo $v['img'];?>" alt="" />
			</a>
			<div class="title">[包邮]
				<a href="<?php echo U('Content/index',array('gid'=>$v['gid']));?>"><?php echo mb_substr($v['gname'],0,20,'utf-8');?>...</a>
			</div>
			<div class="money">
				<span class="rmb">￥</span><b><?php echo $v['shopprice'];?></b>
				<span class="old thr">￥<?php echo $v['marketprice'];?></span>
				<span class="old">(4.0折)</span>
				<a href="" class="shop">加入购物车</a>
			</div>
		</li>
		<?php }}?>
	</ul>
	<script type="text/javascript">
		//列表图动画效果
		$(function(){
			$('#goodsList li').hover(function(){
				$(this).find('img').addClass('animated fadeIn');
				$(this).find('.title').addClass('animated flipInX');
			},function(){
				$(this).find('img').removeClass('fadeIn');
				$(this).find('.title').removeClass('flipInX');
			})
		})
	</script>
</div>
<!-- 商品列表结束 -->

<!-- 分页开始 -->
<div id="page">
	<div class="cen">
		<a class="btn1" href="">上一页</a>
		<a class="click" href="">1</a>
		<a href="">2</a>
		<a href="">3</a>
		<a href="">…</a>
		<a href="">19</a>
		<a class="btn2" href="">下一页</a>
	</div>
	
</div>
<!-- 分页结束 -->
<div id="hr"></div>

<!-- 底部开始 -->
<div id="bottom">
	<div class="bo_l">
		<img src="http://localhost/juanpi/Static/Home/images/jp-app-90.png" alt="" /><br />
		扫描二维码下载
	</div>
	<div class="bo_c">
		<ul>
     		<p>获取更新</p>
			<li>●&nbsp;<a href="">iPhone/Android</a></li>
			<li>●&nbsp;<a href="">卷皮QQ空间</a></li>
			<li>●&nbsp;<a href="">卷皮新浪微博</a></li>
			<li>●&nbsp;<a href="">开放API</a></li>
		</ul>
		<ul>
     		<p>商务合作</p>
			<li>●&nbsp;<a href="">卖家免费报名</a></li>
			<li>●&nbsp;<a href="">商务合作</a></li>
			<li>●&nbsp;<a href="">廉政邮箱</a></li>
			<li>●&nbsp;<a href="">lianzheng@juanpi.com</a></li>
		</ul>
		<ul>
     		<p>公司信息</p>
			<li>●&nbsp;<a href="">关于卷皮</a></li>
			<li>●&nbsp;<a href="">媒体报道</a></li>
			<li>●&nbsp;<a href="">诚聘英才</a></li>
			<li>●&nbsp;<a href="">校园大使招募</a></li>
		</ul>
		<ul>
     		<p>帮助中心</p>
			<li>●&nbsp;<a href="">新手上路</a></li>
			<li>●&nbsp;<a href="">积分攻略</a></li>
			<li>●&nbsp;<a href="">网站地图</a></li>
		</ul>
	</div>
	<div class="bo_r">
		<a href=""></a>
		<span>周一至周日<br />9:00-22:00</span>
	</div>
</div>
<!-- 友情链接 -->
<div id="flink">
	 友情链接：
    <a href="">国画</a>
    <a href="">齐家装修</a>
    <a href="">大朴网</a>
    <a href="">世界名表</a>
    <a href="">葡萄酒</a>
    <a href="">易登网</a>
    <a href="">普洱茶</a>
    <a href="">中关村商城</a>
    <a href="">品牌鞋</a>
    <a href="">乐蜂网优惠券</a>
    <a href="">精选折扣</a>
    <a href="">拍鞋网官网</a>
	<a class="more" href="">更多>></a>
</div>


<div id="copy">
	武汉奇米网络科技有限公司 鄂ICP备10209250号　　Copyright © 2010 -2015 JuanPi.com All Rights Reserved
</div>

<div id="safe">
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_315online.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_cnnic.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_gongshang.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/sm_124x47.png" alt="" /></a>
</div>
<!-- 底部结束 -->
</body>
</html>
